<template>
  <div class="partiton-con">
    <ul class="partiton-con-ul">
      <li class="partiton-con-li" v-for="(item,index) in subjectlist" :key="index">
        <!-- <router-link :to="'/partionlist/'+ item.categoryId"> -->
        <router-link :to="{name:'partionlist',params:{categoryId:item.categoryId,name:item.name}}">
          <img :src="item.cover" alt />
          <p>{{item.name}}</p>
        </router-link>
      </li>
    </ul>
  </div>
</template>
<script>
import { getSubject } from "../../api/forum-api";
export default {
  data() {
    return {
      subjectlist: []
    };
  },
  created() {
    getSubject().then(res => {
      console.log(res.rows);
      this.subjectlist = res.rows;
    });
  }
};
</script>
<style lang="less" scoped>
.partiton-con {
  &-ul {
    width: 100%;
    .partiton-con-li {
      width: calc(100% / 3);
      height: 160px;
      box-sizing: border-box;
      padding: 10px;
      //   margin:10px;
      float: left;
      text-align: center;
      border-radius: 10px;
      img {
        width: 100%;
        height: 80px;
        border-radius: 10px;
      }
      p {
        font-family: "华文行楷";
        font-size: 20px;
        color: #666;
      }
    }
  }
}
</style>